/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: mirac
 * Date: 2025-07-21
 * Time: 12:25
 */
class Person implements Cloneable{
    public String name;

    public Person(String name) {
        this.name = name;
    }
    //重写clone方法
    protected Object clone() throws CloneNotSupportedException{
        return super.clone();      //这里发生了编译时异常
    }
}

public class Main_2 {
    public static void main(String[] args) throws CloneNotSupportedException{
        Person person1 = new Person("小明");
        Person person2 = (Person) person1.clone();
    }
}
